<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci = & get_instance();
	if(!isUserLogin()){
		redirect(site_url());exit();
	}
	$USER = $ci->user_entity->init('id', getUserId());
	
?>
<div id="center_content">
	<div class="clrboth"></div>
	<div class="block">
		<div class="title" style="position:relative;">
			<h3 class="bold"><a href="<?php echo site_url("cricket/user/dashboard")?>">Dashboard</a> &raquo; Deposit Funds</h3>
			<a class="back_button2" href="<?php echo site_url("cricket/user/dashboard")?>" title="Back?">Back?</a>	
		</div>
		<div class="clrboth"></div>
		<div class="content">
			<div class="rowitem3">
				<div class="clrboth"></div>
				Enter the amount you wish to deposit: <input type="text" name="amount" size="30" maxlength="10" style="text-align:center;" /> INR
				<div class="clrboth"></div>
				<br/><br/>
				<div class="clrboth"></div>
				
				<div id="ccavenue" style="float:left;margin-left:50px;">
					<input type="radio" name="payment_method" checked="checked" value="ccavenue" />
					<img src="<?php echo site_url();?>/addons/default/themes/clicxa/css/images/ccavanue.png" />
				</div>
				
				<div id="paypal" style="float:left;margin-left:100px;margin-top:30px;">
					<input type="radio" name="payment_method" value="paypal" />
					<img src="<?php echo site_url();?>/addons/default/themes/clicxa/css/images/paypal.png" />
				</div>	
				
				<div class="clrboth"></div>
				
				<input type="button" id="paynow" value="PAY NOW" style="float:left;margin-top:30px;margin-left:250px;" />
			</div>	
			<div class="clrboth"></div>
		</div>
	</div>	
	<div class="clrboth"></div>
</div>

<script type="text/javascript">
	google.setOnLoadCallback(function() {
		$('#paynow').bind('click',function(){
			$pack= $('input[name=payment_method]:checked').val();
			$amount = $('input[name=amount]').val();
			if(!isNaturalNumber($amount) || $amount == 0){
				alert("The Amount is not validated.");
				return false;
			}
			
			queryURL(BASE_URI + "cricket/account/deposit_funds_submit?method="+$pack+"&amount="+$amount);
		});
	});
	

</script>
